package com.kantboot.business.talent.domain.entity;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Getter
@Setter
@Table(name = "bus_talent_expert_level_condition")
@Accessors(chain = true)
@EntityListeners(AuditingEntityListener.class)
@DynamicUpdate
@DynamicInsert
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class BusTalentExpertLevelCondition implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 创建时间
     */
    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @CreatedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;

    /**
     * 职称等级ID
     */
    @Column(name = "title_level_id")
    private Long titleLevelId;

    /**
     * 显示的优先级
     * 优先级越高，显示越靠前
     */
    @Column(name = "t_priority")
    private Integer priority;

    /**
     * 从事本系列工作最低年限
     */
    @Column(name = "work_years")
    private Integer workYears;

    /**
     * 需要满足的技能等级
     */
    @Column(name = "need_skill_level_id")
    private Long needSkillLevelId;

    /**
     * 获得 `需要满足的技能等级` 后的工作年满
     */
    @Column(name = "need_skill_level_work_years")
    private Integer needSkillLevelWorkYears;

    /**
     * 需要的职称等级ID
     */
    @Column(name = "need_title_level_id")
    private Long needTitleLevelId;

    /**
     * 职称等级需要的年满
     */
    @Column(name = "need_title_level_work_years")
    private Integer needTitleLevelWorkYears;

    /**
     * 绩效考核满足分数
     */
    @Column(name = "performance_score")
    private BigDecimal performanceScore;

    /**
     * `绩效考核满足分数`年满
     */
    @Column(name = "performance_score_years")
    private Integer performanceScoreYears;

    /**
     * 距法定退休年龄 多少 年以上
     */
    @Column(name = "retirement_age_beyond")
    private Integer retirementAgeBeyond;

    /**
     * 是否需要奖章
     */
    @Column(name = "is_need_award")
    private Boolean isNeedAward;

    /**
     * 是否需要满足公司评选的专业委员会制定的业绩条件
     * 主要用于 首席专家 和 中国电科院院士 评选
     * isNeedMeetPerformanceCondition
     */
    @Column(name = "is_need_meet_performance_condition")
    private Boolean isNeedMeetPerformanceCondition;

    /**
     * 描述
     */
    @Column(name = "description",length = 5000)
    private String description;

}
